package com.ruoyi.lightkillPest.service.impl;

import com.aliyun.iot20180120.Client;
import com.aliyun.teaopenapi.models.Config;
import com.ruoyi.lightkillPest.service.AliyunClientServiceForSCD;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class AliyunClientServiceForSCDImpl implements AliyunClientServiceForSCD {

    @Value("${aliyun.accessKeyId_lgz}")
    private String accessKeyId;

    @Value("${aliyun.accessKeySecret_lgz}")
    private String accessKeySecret;

    @Value("${aliyun.endpoints}")
    private String endPoints;

    @Override
    public Client creatClient() throws Exception {

        Config config = new Config();
        config.accessKeyId = accessKeyId;
        config.accessKeySecret = accessKeySecret;
        config.regionId = "cn-shanghai";

        return new Client(config);
    }
}
